package com.ytjj.qmyx.admin.controller.data;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.admin.model.request.dataStatistics.DataStatisticsRequest;
import com.ytjj.qmyx.admin.service.data.PlatformStatisticService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description 平台统计
 **/

@RestController
@RequestMapping("/platformStatistics")
public class PlatformStatisticController {

    @Resource
    private PlatformStatisticService platformStatisticService;

    /**
     * 平台统计
     * @param dataStatisticsRequest
     * @return
     */
    @PostMapping("/getPlatformStatisticsList")
    public CommonResult getPlatformStatisticsList(@RequestBody DataStatisticsRequest dataStatisticsRequest) {
        return CommonResult.success(platformStatisticService.getPlatformStatisticsList(dataStatisticsRequest));
    }

    /**
     * 平台统计-财务平台统计
     * @param request
     * @return
     */
    @PostMapping("/getStatisticsByFinance")
    public CommonResult statisticsByFinance(@RequestBody DataStatisticsRequest request) {
        return CommonResult.success(platformStatisticService.getStatisticsByFinance(request));
    }

    /**
     * 平台统计-按活动
     * @param dataStatisticsRequest
     * @return
     */
    @PostMapping("/getActivityStatisticsList")
    public CommonResult getActivityStatisticsList(@RequestBody DataStatisticsRequest dataStatisticsRequest) {
        return CommonResult.success(platformStatisticService.getActivityStatisticsList(dataStatisticsRequest));
    }
}